home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_whipidol.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  77 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_whipIdol.cog
  4. #
  5. # Knock an idol from its perch
  6. #
  7. # [TL] [GGJ]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ===================================================================
  11. symbols
  12.  
  13. message        startup
  14. message        damaged
  15. message        entered
  16.  
  17. thing        idol        mask=0x08
  18. thing        idolTarg    mask=0x08
  19. thing        splash0        local
  20.  
  21. sector        water        mask=0x020
  22.  
  23. sound        splashSnd=pru_idol_splash.wav    local
  24.  
  25. material    mat1=gen_a4sfx_splash.mat         local
  26. material    mat2=gen_a4sfx_splash.mat        local
  27.  
  28. template    splashTpl=splashenter              local
  29.  
  30. int            hit=0        local
  31.  
  32. end
  33.  
  34. # ===================================================================
  35. code
  36.  
  37. startup:
  38.  
  39.     ClearThingFlags(idolTarg, 0x4); # Clear no weapon collide flag
  40.     return;
  41.  
  42. # -------------------------------------------------------------------
  43.  
  44. damaged:
  45.     
  46.     if (GetSenderRef() != idolTarg) return;
  47.  
  48.     if (GetParam(1) == 0x10)
  49.     {
  50.         DestroyThing(idolTarg);
  51.         Sleep(0.01);
  52.         ApplyForce(idol, VectorScale('0.3 0.7 0.5', 0.05));
  53.  
  54.         Sleep(1.0);
  55.         SetThingMass(idol, 200.0);
  56.  
  57.         Sleep(3.0);
  58.         SetPhysicsFlags(idol, 0x400000);
  59.     }
  60.     return;
  61.  
  62. # -------------------------------------------------------------------
  63.  
  64. entered:
  65.  
  66.     if ((GetSenderRef() == water) && (GetSourceRef() == idol))
  67.     {
  68.         splash0 = CreateThing(splashTpl, idol);
  69.         MaterialAnim(mat1, 16, 0x0);
  70.         MaterialAnim(mat2, 16, 0x0);
  71.         PlaySoundThing(splashSnd, splash0, 0.8, -1.0, -1.0, 0);
  72.         SetLifeLeft(splash0, 0.5);
  73.     }
  74.     return;
  75.  
  76. end
  77.